<template>
	<view>
		<view>
			<image class="image" :src='get_img'></image>
			<view class="title" style="padding-top: 60rpx;">抽奖记录</view>
		</view>
		<view>
			<view class="record" v-for="(item,index) in list" :key='index'>
				<view class="record_">
					<view style="width: 255rpx;float: left;font-size: 12px;">
						<p>{{item.content}}</p>
					</view>
					
				</view>
				<view class="time">
					<view>{{item.created_at}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				get_img:this.$get_img+"sys/icon/prize.png",
				page:1,
				num:20,
				is_reach:false
			}
		},
		onReachBottom() {
			if(!this.is_reach){
				this.page++
				this.get_log()
			}
			
		},
		onLoad() {
			this.get_log()
		},
		methods: {
			get_log(){
				let that=this
				this.$model.get("user/common/get_draw_log?page="+this.page+"&num="+this.num).then(res=>{
					if(res.code==200){
						if(res.data.data.length==0){
							that.is_reach=true
						}
						res.data.data.forEach(function(value){
							that.list.push(value)
						})
					}
				})
			}
		}
	}
</script>

<style>
	.image {
		background-repeat: no-repeat;
		background-size: cover;
		background-attachment: fixed;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		z-index: -1;
	}

	.title {
		color: #ffff00;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		letter-spacing: 10rpx;
		font-size: 45rpx;
	}

	.record {
		color: #ffff00;
		margin-top: 80rpx;
		padding: 5rpx 0 5rpx 0;
		/* margin: 40rpx 0 40rpx 0; */
		/* background-color: rgba(255, 255, 255, .5); */

	}

	.record_ {
		width: 295rpx;
		float: left;
	}

	.record_ image {
		width: 30rpx;
		height: 40rpx;
	}

	.record_ p {
		margin-left: 50rpx;

	}

	.egg_img {
		width: 40rpx;
		height: 40rpx;
		float: right;
	
	}

	.time {
		float: right;
		width: 350rpx;
		margin-right: 30rpx;
		font-size: 15px;
	}
</style>
